import java.io.File;
import java.io.IOException;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.sf.shiva.oms.biz.OpWaybillJarVerifyBiz;




/**
 * 
 * 
 * 
 * <pre>
 * HISTORY
 * ****************************************************************************
 *  ID    DATE            PERSON            REASON
 *  1     2018年1月5日         la.01367604           Create
 * ****************************************************************************
 * </pre>
 * 
 * @author la.01367604
 * @version 1.0
 */
public class demo1 {

    public static void main(String[] args) {
        String currentVersion = "1.4.1";
        int showVersionNum = 3;
        // String msg =
        // "{\"waybillId\":\"AAABYtMc3hkP8DXX2y9O9oIrA5yuKedC\",\"waybillNo\":\"992654693354\",\"sourceZoneCode\":\"JFK02S\",\"destZoneCode\":\"891\",\"meterageWeightQty\":5.69,\"realWeightQty\":5.69,\"quantity\":152345678901234.682,\"consigneeEmpCode\":\"714004\",\"consignedTm\":\"2018-03-19 14:58:42\",\"cargoTypeCode\":\"C201\",\"limitTypeCode\":\"T4\",\"distanceTypeCode\":\"\",\"transportTypeCode\":\"\",\"expressTypeCode\":\"B1\",\"volume\":0.0,\"billLong\":0.0,\"billWidth\":0.0,\"billHigh\":0.0,\"versionNo\":98,\"lockVersionNo\":98,\"unitWeight\":\"\",\"consValue\":108.0,\"consValueCurrencyCode\":\"USD\",\"productCode\":\"\",\"waybillRemark\":\"\",\"orderNo\":\"00499000000009926546933549\",\"updateTm\":\"2018-04-20 17:24:51\",\"provider\":\"\",\"createTm\":\"2018-04-17 18:23:43\",\"extJson\":\"\",\"actionJson\":\"{\\\"infoUpdate\\\":true}\",\"updateSource\":\"\",\"genOrderFlag\":false,\"operationWaybillAddrCons\":{\"contactsId\":\"AAABYtMc6NcKjxM7i59EWb/gNqReuBAq\",\"consignorCompName\":\"SFBuy\",\"consignorAddr\":\"New Castle,Delaware,1140 River Road 19720\",\"consignorPhone\":\"+001(302)-4076155\",\"consignorContName\":\"SFBUY\",\"consignorMobile\":\"+001(302)-4076155\",\"addresseeCompName\":\"王五\",\"addresseeAddr\":\"西藏自治区拉萨市城关区川藏公路马中山补胎店\",\"addresseePhone\":\"18716453219\",\"addresseeContName\":\"西藏\",\"addresseeMobile\":\"13827441447\",\"consignorAddrNative\":\"\",\"addresseeAddrNative\":\"\",\"waybillNo\":\"992654693354\",\"orderNo\":\"00499000000009926546933549\",\"waybillId\":\"AAABYtMc3hkP8DXX2y9O9oIrA5yuKedC\",\"updateTm\":\"2018-04-20 17:21:33\",\"extJson\":\"\",\"createTm\":\"2018-04-17 18:23:43\",\"consignorCityCode\":\"JFK\",\"consignorDeptCode\":\"\",\"consignorTransitCode\":\"\",\"consignorTeamCode\":\"\",\"addresseeCityCode\":\"A540100000\",\"addresseeDeptCode\":\"755FC\",\"addresseeTransitCode\":\"755WE\",\"addresseeTeamCode\":\"755FC025\",\"pickUpCode\":\"\",\"boxAddress\":\"\"},\"operationWaybillAddrConsList\":[{\"contactsId\":\"AAABYtMc6NcKjxM7i59EWb/gNqReuBAq\",\"consignorCompName\":\"SFBuy\",\"consignorAddr\":\"New Castle,Delaware,1140 River Road 19720\",\"consignorPhone\":\"+001(302)-4076155\",\"consignorContName\":\"SFBUY\",\"consignorMobile\":\"+001(302)-4076155\",\"addresseeCompName\":\"王五\",\"addresseeAddr\":\"西藏自治区拉萨市城关区川藏公路马中山补胎店\",\"addresseePhone\":\"18716453219\",\"addresseeContName\":\"西藏\",\"addresseeMobile\":\"13827441447\",\"consignorAddrNative\":\"\",\"addresseeAddrNative\":\"\",\"waybillNo\":\"992654693354\",\"orderNo\":\"00499000000009926546933549\",\"waybillId\":\"AAABYtMc3hkP8DXX2y9O9oIrA5yuKedC\",\"updateTm\":\"2018-04-20 17:21:33\",\"extJson\":\"\",\"createTm\":\"2018-04-17 18:23:43\",\"consignorCityCode\":\"JFK\",\"consignorDeptCode\":\"\",\"consignorTransitCode\":\"\",\"consignorTeamCode\":\"\",\"addresseeCityCode\":\"A540100000\",\"addresseeDeptCode\":\"755FC\",\"addresseeTransitCode\":\"755WE\",\"addresseeTeamCode\":\"755FC025\",\"pickUpCode\":\"\",\"boxAddress\":\"\"}],\"operationWaybillMarkList\":[{\"labellingId\":\"AAABYuJb1A7P1O4Yf8tJS7tzC2uqU6cY\",\"labellingPattern\":\"SEND_BACK_FLG\",\"waybillNo\":\"992654693354\",\"orderNo\":\"00499000000009926546933549\",\"waybillId\":\"AAABYtMc3hkP8DXX2y9O9oIrA5yuKedC\",\"updateTm\":\"2018-04-20 17:21:32\",\"createTm\":\"2018-04-20 17:21:32\"}],\"operationWaybillFeeList\":[{\"feeId\":\"AAABYtMc656PrddkK0tInojySvrwfABs\",\"feeTypeCode\":\"1\",\"feeAmt\":12.0,\"gatherZoneCode\":\"755AQ\",\"paymentTypeCode\":\"1\",\"settlementTypeCode\":\"2\",\"paymentChangeTypeCode\":\"0\",\"customerAcctCode\":\"7553017474\",\"currencyCode\":\"CNY\",\"gatherEmpCode\":\"90044590\",\"bizOwnerZoneCode\":\"755AQ\",\"feeAmtInd\":12.0,\"feeIndType\":\"1\",\"waybillNo\":\"992654693354\",\"orderNo\":\"00499000000009926546933549\",\"waybillId\":\"AAABYtMc3hkP8DXX2y9O9oIrA5yuKedC\",\"updateTm\":\"2018-04-20 17:26:31\",\"createTm\":\"2018-04-17 18:23:43\"},{\"feeId\":\"AAABYuJb1A1xq1FGWHdG2oEJEPLNoBlX\",\"feeTypeCode\":\"93\",\"feeAmt\":28.0,\"gatherZoneCode\":\"755AQ\",\"paymentTypeCode\":\"1\",\"settlementTypeCode\":\"2\",\"paymentChangeTypeCode\":\"0\",\"customerAcctCode\":\"7553017474\",\"currencyCode\":\"CNY\",\"serviceId\":\"AAABYuJb1A34sbSCiAFOtJwTKvwB2yY2\",\"gatherEmpCode\":\"90044590\",\"destCurrencyCode\":\"RMB\",\"feeAmtInd\":28.0,\"feeIndType\":\"1\",\"waybillNo\":\"992654693354\",\"orderNo\":\"00499000000009926546933549\",\"waybillId\":\"AAABYtMc3hkP8DXX2y9O9oIrA5yuKedC\",\"updateTm\":\"2018-04-20 17:26:31\",\"createTm\":\"2018-04-20 17:21:32\"},{\"feeId\":\"AAABYuJb1A2sDhBiX95NypJ1BIAE+y01\",\"feeTypeCode\":\"3\",\"feeAmt\":2.0,\"gatherZoneCode\":\"755AQ\",\"paymentTypeCode\":\"1\",\"settlementTypeCode\":\"2\",\"paymentChangeTypeCode\":\"0\",\"customerAcctCode\":\"7553017474\",\"currencyCode\":\"CNY\",\"serviceId\":\"AAABYuJb1A0k2m8H/RpD17UJUQeEJ3QS\",\"gatherEmpCode\":\"90044590\",\"bizOwnerZoneCode\":\"755AQ\",\"feeAmtInd\":2.0,\"feeIndType\":\"0\",\"waybillNo\":\"992654693354\",\"orderNo\":\"00499000000009926546933549\",\"waybillId\":\"AAABYtMc3hkP8DXX2y9O9oIrA5yuKedC\",\"updateTm\":\"2018-04-20 17:26:31\",\"createTm\":\"2018-04-20 17:21:32\"}],\"operationWaybillAdditionList\":[{\"additionalId\":\"AAABYtwzhcceXxv52BhMva3w/GM8j8Jl\",\"additionalKey\":\"ORIGINAL_NUMBER\",\"additionalValues\":\"2018031914510195270678\",\"waybillNo\":\"992654693354\",\"orderNo\":\"00499000000009926546933549\",\"waybillId\":\"AAABYtMc3hkP8DXX2y9O9oIrA5yuKedC\",\"updateTm\":\"2018-04-19 12:39:51\",\"extJson\":\"\",\"createTm\":\"2018-04-19 12:39:51\"},{\"additionalId\":\"AAABYtwzhccz6VOggXtDDYJh8i6Jy3qu\",\"additionalKey\":\"PAYMENT_NUMBER\",\"additionalValues\":\"\",\"waybillNo\":\"992654693354\",\"orderNo\":\"00499000000009926546933549\",\"waybillId\":\"AAABYtMc3hkP8DXX2y9O9oIrA5yuKedC\",\"updateTm\":\"2018-04-19 12:39:51\",\"extJson\":\"\",\"createTm\":\"2018-04-19 12:39:51\"},{\"additionalId\":\"AAABYtwzhcfHsMmyEvhOlYUqBXPzUklz\",\"additionalKey\":\"LIST_ONESELF_PICK_UP_FLG\",\"additionalValues\":\"0\",\"waybillNo\":\"992654693354\",\"orderNo\":\"00499000000009926546933549\",\"waybillId\":\"AAABYtMc3hkP8DXX2y9O9oIrA5yuKedC\",\"updateTm\":\"2018-04-19 12:39:51\",\"extJson\":\"\",\"createTm\":\"2018-04-19 12:39:51\"}],\"operationWaybillCustoms\":{\"exportId\":\"AAABYtMhp4kWtInQs1tIoI4PWWjXKAuu\",\"customsBatchs\":\"HKG2323TSN\",\"customsTypeCode\":\"\",\"preCustomsDt\":\"2018-03-19 14:58:35\",\"sourcearea\":\"US\",\"consignorPostalCode\":\"19720\",\"addresseePostalCode\":\"\",\"countryCode\":\"US\",\"consignorTaxNo\":\"\",\"unifiedCode\":\"\",\"twinvoiceTypeCode\":\"0\",\"consultCode\":\"\",\"waybillNo\":\"992654693354\",\"orderNo\":\"00499000000009926546933549\",\"waybillId\":\"AAABYtMc3hkP8DXX2y9O9oIrA5yuKedC\",\"updateTm\":\"2018-04-19 12:39:51\",\"extJson\":\"\",\"createTm\":\"2018-04-17 18:23:43\"},\"operationWaybillCustomsList\":[{\"exportId\":\"AAABYtMhp4kWtInQs1tIoI4PWWjXKAuu\",\"customsBatchs\":\"HKG2323TSN\",\"customsTypeCode\":\"\",\"preCustomsDt\":\"2018-03-19 14:58:35\",\"sourcearea\":\"US\",\"consignorPostalCode\":\"19720\",\"addresseePostalCode\":\"\",\"countryCode\":\"US\",\"consignorTaxNo\":\"\",\"unifiedCode\":\"\",\"twinvoiceTypeCode\":\"0\",\"consultCode\":\"\",\"waybillNo\":\"992654693354\",\"orderNo\":\"00499000000009926546933549\",\"waybillId\":\"AAABYtMc3hkP8DXX2y9O9oIrA5yuKedC\",\"updateTm\":\"2018-04-19 12:39:51\",\"extJson\":\"\",\"createTm\":\"2018-04-17 18:23:43\"}],\"operationWaybillServiceList\":[{\"serviceId\":\"AAABYuJb1A0k2m8H/RpD17UJUQeEJ3QS\",\"serviceProdCode\":\"IN02\",\"attribute1\":\"1000.0\",\"waybillNo\":\"992654693354\",\"orderNo\":\"00499000000009926546933549\",\"waybillId\":\"AAABYtMc3hkP8DXX2y9O9oIrA5yuKedC\",\"updateTm\":\"2018-04-20 17:26:31\",\"createTm\":\"2018-04-20 17:21:32\"},{\"serviceId\":\"AAABYuJb1A34sbSCiAFOtJwTKvwB2yY2\",\"serviceProdCode\":\"IN101\",\"attribute1\":\"2\",\"waybillNo\":\"992654693354\",\"orderNo\":\"00499000000009926546933549\",\"waybillId\":\"AAABYtMc3hkP8DXX2y9O9oIrA5yuKedC\",\"updateTm\":\"2018-04-20 17:26:31\",\"createTm\":\"2018-04-20 17:21:32\"}],\"operationWaybillPackageList\":[{\"packageId\":\"AAABYtMdO1dO6g0Hm7RPsJQW7gxLo2ry\",\"packageNo\":\"992654693354\",\"packageLong\":0.0,\"packageWidth\":0.0,\"packageHigh\":0.0,\"packageVolume\":0.0,\"packageUnitWeight\":\"\",\"packageWeight\":0.0,\"waybillNo\":\"992654693354\",\"orderNo\":\"00499000000009926546933549\",\"waybillId\":\"AAABYtMc3hkP8DXX2y9O9oIrA5yuKedC\",\"updateTm\":\"2018-04-19 12:39:51\",\"extJson\":\"\",\"createTm\":\"2018-04-17 18:23:43\",\"operationWaybillConsignList\":[{\"consId\":\"AAABYuJXjDYOIxECEAlGoaKA5hGNaMH+\",\"consName\":\"ry24 fry35\",\"consQty\":\"1\",\"weightQty\":0.0,\"consValue\":54.0,\"qtyUnit\":\"个\",\"productRecordNo\":\"\",\"packageId\":\"AAABYtMdO1dO6g0Hm7RPsJQW7gxLo2ry\",\"packageNo\":\"992654693354\",\"orderNo\":\"00499000000009926546933549\",\"waybillId\":\"AAABYtMc3hkP8DXX2y9O9oIrA5yuKedC\",\"updateTm\":\"2018-04-20 17:16:56\",\"extJson\":\"\",\"createTm\":\"2018-04-20 17:16:56\"},{\"consId\":\"AAABYuJXjDZecHCTLj1Nm4hcjIOCMPei\",\"consName\":\"ry235y ry245\",\"consQty\":\"1\",\"weightQty\":0.0,\"consValue\":54.0,\"qtyUnit\":\"个\",\"productRecordNo\":\"\",\"packageId\":\"AAABYtMdO1dO6g0Hm7RPsJQW7gxLo2ry\",\"packageNo\":\"992654693354\",\"orderNo\":\"00499000000009926546933549\",\"waybillId\":\"AAABYtMc3hkP8DXX2y9O9oIrA5yuKedC\",\"updateTm\":\"2018-04-20 17:16:56\",\"extJson\":\"\",\"createTm\":\"2018-04-20 17:16:56\"}]},{\"packageId\":\"AAABYtwzhcmZQuIroaRDjZquagBxEvp/\",\"packageNo\":\"004005743545\",\"packageLong\":0.0,\"packageWidth\":0.0,\"packageHigh\":0.0,\"packageVolume\":0.0,\"packageUnitWeight\":\"\",\"packageWeight\":0.0,\"waybillNo\":\"992654693354\",\"orderNo\":\"00499000000009926546933549\",\"waybillId\":\"AAABYtMc3hkP8DXX2y9O9oIrA5yuKedC\",\"updateTm\":\"2018-04-19 12:39:51\",\"extJson\":\"\",\"createTm\":\"2018-04-19 12:39:51\",\"operationWaybillConsignList\":[]}],\"operationTaxbillInfoList\":[],\"optWaybillAdditionExtList\":[{\"extId\":\"AAABYuJXjDcD4swDLT5AHqwwivOe0wY9\",\"waybillId\":\"AAABYtMc3hkP8DXX2y9O9oIrA5yuKedC\",\"waybillNo\":\"992654693354\",\"orderNo\":\"00499000000009926546933549\",\"attr001\":\"2018031914510195270678\",\"attr002\":\"\",\"attr003\":\"\",\"attr004\":\"\",\"attr005\":\"\",\"attr006\":\"\",\"attr007\":\"\",\"attr008\":\"\",\"attr009\":\"\",\"attr010\":\"\",\"attr011\":\"\",\"attr012\":\"\",\"attr013\":\"\",\"attr014\":\"\",\"attr015\":\"\",\"attr016\":\"\",\"attr017\":\"\",\"attr018\":\"\",\"attr019\":\"\",\"attr020\":\"\",\"attr021\":\"\",\"attr022\":\"\",\"attr023\":\"\",\"attr024\":\"\",\"attr025\":\"\",\"attr026\":\"\",\"attr027\":\"\",\"attr028\":\"\",\"attr029\":\"\",\"attr030\":\"\",\"attr031\":\"\",\"attr032\":\"\",\"attr033\":\"\",\"attr034\":\"\",\"attr035\":\"\",\"attr036\":\"\",\"attr037\":\"\",\"attr038\":\"\",\"attr039\":\"\",\"attr040\":\"\",\"attr041\":\"\",\"attr042\":\"\",\"attr043\":\"\",\"attr044\":\"\",\"attr045\":\"\",\"attr046\":\"\",\"attr047\":\"\",\"attr048\":\"\",\"attr049\":\"\",\"attr050\":\"\",\"createTime\":\"2018-04-20 17:16:56\",\"updateTm\":\"2018-04-20 17:16:56\",\"extJson\":\"\"}],\"optWaybillSpecialHandlerList\":[],\"clientCode\":\"SFBUY_WMS\",\"currentSource\":\"BACK_SEND\"}";
        try {
            File directory = new File(""); // 当前路径
            ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
            OpWaybillJarVerifyBiz opWaybillJarVerifyBiz = (OpWaybillJarVerifyBiz) ctx.getBean("opWaybillJarVerifyBiz");
            opWaybillJarVerifyBiz.setResourceFileDir(directory.getCanonicalPath() + "\\resources");
            opWaybillJarVerifyBiz.compObjectByVersions(currentVersion, showVersionNum);
            if (opWaybillJarVerifyBiz.verifyJson2Object("demo.txt")) {
                System.out.println("=====demo.txt的json报文转换成功=====");
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

        System.out.println("=========验证完成-oms.ow.dto." + currentVersion + "=========");
    }
    
}
